//
//  DriverAddNoDataCell.m
//  LogisticsSupplier
//
//  Created by 吕晶 on 2021/3/24.
//  Copyright © 2021 吕晶. All rights reserved.
//

#import "DriverAddNoDataCell.h"

@interface DriverAddNoDataCell ()

@property (nonatomic, strong) UIView *bgView;

@end

@implementation DriverAddNoDataCell

+ (instancetype)DriverAddNoDataCellWithTableView:(UITableView *)tableView {
    static NSString *cellID = @"DriverAddNoDataCell";
    DriverAddNoDataCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[DriverAddNoDataCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = Color_backgroundColor;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        self.bgView = [[UIView alloc] initWithFrame:CGRectMake(15, 0, ScreenW - 30, 450)];
        self.bgView.backgroundColor = HexColor(0xffffff);
        [self.contentView addSubview:self.bgView];
        
        UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake((self.bgView.nim_width - 206) * 0.5, 25, 206, 173)];
        imgView.image = [UIImage imageNamed:@"img_driver"];
        [self.bgView addSubview:imgView];
        
        UILabel *title1Lab = [[UILabel alloc] initWithFrame:CGRectMake(0, imgView.nim_bottom + 3, self.bgView.nim_width, 21)];
        title1Lab.textColor = HexColor(0x2B2C44);
        title1Lab.font = BoldFontOfSize(20);
        title1Lab.text = @"未搜索到该司机";
        title1Lab.textAlignment = NSTextAlignmentCenter;
        [self.bgView addSubview:title1Lab];
        
        UILabel *title2Lab = [[UILabel alloc] initWithFrame:CGRectMake(0, title1Lab.nim_bottom + 20, self.bgView.nim_width, 15)];
        title2Lab.textColor = HexColor(0x9C9DB3);
        title2Lab.font = [UIFont systemFontOfSize:14];
        title2Lab.text = @"1. 请检查搜索内容是否正确；";
        title2Lab.textAlignment = NSTextAlignmentCenter;
        [self.bgView addSubview:title2Lab];
        
        UILabel *title3Lab = [[UILabel alloc] initWithFrame:CGRectMake(0, title2Lab.nim_bottom + 10, self.bgView.nim_width, 15)];
        title3Lab.textColor = HexColor(0x9C9DB3);
        title3Lab.font = [UIFont systemFontOfSize:14];
        title3Lab.text = @"2. 该司机未在平台上注册。";
        title3Lab.textAlignment = NSTextAlignmentCenter;
        [self.bgView addSubview:title3Lab];
        
        UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake((self.bgView.nim_width - 228) * 0.5, title3Lab.nim_bottom + 30, 228, 44)];
        [btn setBackgroundColor:HexColorA(0x3D68EB, 0.1)];
        btn.layer.masksToBounds = YES;
        btn.layer.cornerRadius = 6;
        [btn setTitle:@"邀请司机注册" forState:0];
        [btn setTitleColor:HexColor(0x3D68EB) forState:0];
        btn.titleLabel.font = BoldFontOfSize(16);
        [btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
        [self.bgView addSubview:btn];
        
        self.height = self.bgView.nim_bottom;
        
    }
    return self;
}

- (void)btnClick {
    if (self.inviteBlock) {
        self.inviteBlock();
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
